// AccessPropertySelectionFactory.cpp: implementation of the AccessPropertySelectionFactory class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "AccessPropertySelectionFactory.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
namespace pa
{
     AccessPropertySelectionFactory::AccessPropertySelectionFactory()
	 {

	 }

     AccessPropertySelectionFactory::~AccessPropertySelectionFactory()
	 {	   
	 }
	 
	 OriginalPropertySet AccessPropertySelectionFactory::NewSelection
		 (const StdString& strOwerID,const StdString& strTable,const StdString& strSource)
	 {
		 ASSERT(!strOwerID.IsEmpty());
	     ASSERT(!strTable.IsEmpty());
	     StdString strSql;
	     strSql.Format(_T("select * from %s where ID = '%s'"), strTable, strOwerID);
		 
		 UEConnectionPtr pConnectionPtr = UEConnectionManager::Instance().GetConnection(strSource);
         return pConnectionPtr->ExecuteSelectSQL(strSql);

	 }

	 OriginalPropertySet AccessPropertySelectionFactory::NewSelection
		 (int strOwerID,const StdString& strTable,const StdString& strSource)
	 {
		 ASSERT(!strTable.IsEmpty());
	     StdString strSql;
	     strSql.Format(_T("select * from %s where ID = %d"), strTable, strOwerID);
		 UEConnectionPtr pConnectionPtr = UEConnectionManager::Instance().GetConnection(strSource);
         return pConnectionPtr->ExecuteSelectSQL(strSql);

	 } 

};